function water_number = get_water_location(result_e,new_number,water_line)
% close all
% clear
% load('matlab.mat')
% dbstop if error
%%
new_number(:,1) = new_number(:,1)+0.25;
%%
result = [];
for i = 1:size(result_e,1)-1
    if result_e(i,2)>water_line
        break;
    end
    x1 = result_e(i,2);x2 = result_e(i+1,2);
    y1 = new_number(i,1);y2 = new_number(i+1,1);
    score = y1+(y2-y1)/(x2-x1)*(water_line-x1);
    result = [result;score,1/(water_line-x1)];
end
result = sum(result(:,1).*result(:,2)/sum(result(:,2)));
water_number = round(result*100)/10;